import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in) ;
		int data[] = new int [5] ;
		String str = null ;
		while(true){
			String choice = sc.next() ;
			switch(choice)
			{
				case "arr":
					int i = sc.nextInt() ;
					try{
						data[i] = 1 ;
					}catch(ArrayIndexOutOfBoundsException e){
						System.out.println(e);
					}
					break ;
				case "null":
					try{
						NullPointerException e = new NullPointerException();
						throw e ;
					}catch(NullPointerException e){
						System.out.println(e);
					}
					break ;
				case "cast" :
					try{
						String st = "abc" ;
						ClassCastException e = new ClassCastException("java.lang.String cannot be cast to java.lang.Integer") ;
						throw e ;
					}catch(Exception e){
						System.out.println(e);
					}
					break ;
				case "num":
					try{
						String s = sc.next() ;
						int num = Integer.parseInt(s) ;
					}catch(NumberFormatException e){
						System.out.println(e);
					}
					break ;
				default:
					break ;
			}
		}
	}
}